<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:80:"E:\phpStudy\WWW\huanhuizhangwu\public/../application/admin\view\login\index.html";i:1562325706;}*/ ?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title><?php echo $title; ?></title>
        <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <link rel="stylesheet" type="text/css" href="/static/home/lib/bootstrap/css/bootstrap.css">

        <link rel="stylesheet" type="text/css" href="/static/home/stylesheets/theme.css">
        <link rel="stylesheet" href="/static/home/lib/font-awesome/css/font-awesome.css">

        <script src="/static/home/lib/jquery-1.7.2.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="/static/layer/layer.js"></script>
        <script src="/static/laydate/laydate.js"></script>
        
        <!-- Demo page code -->

        <style type="text/css">
            #line-chart {
                height:300px;
                width:800px;
                margin: 0px auto;
                margin-top: 1em;
            }
            .brand { font-family: georgia, serif; }
            .brand .first {
                color: #ccc;
                font-style: italic;
            }
            .brand .second {
                color: #fff;
                font-weight: bold;
            }
        </style>

        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

        <!-- Le fav and touch icons -->
        <link rel="shortcut icon" href="../assets/ico/favicon.ico">
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
    </head>

    <!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
    <!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
    <!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
    <!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
    <!--[if (gt IE 9)|!(IE)]><!--> 
    <body> 
        <!--<![endif]-->

        <div class="navbar">
            <div class="navbar-inner">
                <ul class="nav pull-right">

                </ul>
                <a class="brand" href="index.html"><span class="first"></span> <span class="second">换汇账务系统</span></a>
            </div>
        </div>

        <div class="row-fluid">
            <div class="dialog">
                <div class="block">
                    <p class="block-heading">登录</p>
                    <div class="block-body">
                        <form name="logform">
                            <label>用户名</label>
                            <input type="text" class="span12" name="u_username">
                            <label>密码</label>
                            <input type="password" class="span12" name="u_password">
                            
                            <label>验证码</label>
                            <input type="text" class="span" name="captcha" style="width:110px;">
                            <div style="margin-top: -45px;margin-left: 130px;">
                                <img name="yanzhenma" src="<?php echo captcha_src(); ?>" alt="captcha" onclick="this.src='<?php echo captcha_src(); ?>?'+Math.random();" style="cursor:pointer;"/>
                            </div>
                            
                            <a class="btn btn-primary pull-right logbut" id="logbut">确认</a>
                            <label class="remember-me"><input type="checkbox"> Remember me</label>
                            <div class="clearfix"></div>
                        </form>
                    </div>
                </div>

            </div>
        </div>

        <script src="/static/home/lib/bootstrap/js/bootstrap.js"></script>
        <script type="text/javascript">
            $("#logbut").click(function () {
                //alert($("[name=logform]").serialize());
                //var rem = $("input[name='remember']").is(':checked');
//                        if (rem == true)
//                        {
//                            rem = 1;
//                        }

                var uname = $("[name=u_username]").val();
                var pwd = $("[name=u_password]").val();
                var captcha = $("[name=captcha]").val();
                if (uname == "")
                {
                    layer.msg("用户名不能为空！", {time: 1200, offset: '210px'});
                    $("[name=u_username]").focus();
                    return;
                }

                if (pwd == "")
                {
                    layer.msg("密码不能为空！", {time: 1200, offset: '210px'});
                    $("[name=u_password]").focus();
                    return;
                }
                
                if (captcha == "")
                {
                    layer.msg("验证码不能为空！", {time: 1200, offset: '210px'});
                    $("[name=captcha]").focus();
                    return;
                }

                $.ajax({
                    type: "post",
                    url: "<?php echo url('admin/Login/checklogin'); ?>",
                    data: $("[name=logform]").serialize(),
                    dataType: 'json',
                    success: function (data) {
                        if (data.status == 1)
                        {
                            layer.msg(data.message, {time: 1200, offset: '210px'}, function () {

                                window.location.href = "<?php echo url('/homepage'); ?>";

                                //alert(1);
                            });
                        } else if (data.status == 2)
                        {
                            layer.msg(data.message, {time: 1200, offset: '210px'}, function () {
                                $("[name=yanzhenma]").click();


                            });

                        }
                        //验证码
                        else if(data.status==3)
                        {
                            layer.msg(data.message, {time: 1200, offset: '210px'}, function () {
                                
                               $("[name=u_password]").val(""); 
                               $("[name=yanzhenma]").click();

                            });
                        }
                        else {
                            layer.msg(data.message, {time: 1200, offset: '210px'}, function () {
                                window.location.reload();
                            });
                        }
                    }
                })
            });
            $(function () {
                $('body').keydown(function (event) {
                    if (event.keyCode == '13') {

                        $("#logbut").click();


                    }
                });
            });
            $("[rel=tooltip]").tooltip();
            $(function () {
                $('.demo-cancel-click').click(function () {
                    return false;
                });
            });
        </script>

    </body>
</html>


